<?php
include 'update_3_6_1/file/msg_config.php';
foreach ($arrMsgConfigs  as $key=>$val){
	$msginfo = db_factory::get_one("SELECT * FROM `".TABLEPRE."witkey_msg_tpl` WHERE tpl_code = '".$val['tpl_code']."' and send_type = 1");
	if(!$msginfo){
		db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` (config_id, k,obj,desc,prompt,on_time) VALUES (
				'".$val['config_id']."',
				'".$val['k']."',
				'".$val['obj']."',
				'".$val['desc']."',
				'".$val['prompt']."',
				'".time()."'
				)");
	}
}
unset($msginfo);
unset($arrMsgConfigs);
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='space_change'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='task_unfreeze'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='auto_choose'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='shop_auth_success'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='shop_auth_fail'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='shop_open'");
db_factory::execute("DELETE FROM `".TABLEPRE."witkey_msg_config` WHERE k ='shop_close'");



db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('157', 'task_end_manually', 'task', '任务结束通知', '管理员后台手动结束任务时用户会收到此通知。', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('158', 'alipayjs_auth', 'auth', '支付宝认证通知', '后台打款给用户的时候', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_config` VALUES ('159', 'alipayjs_auth', 'auth', '支付宝认证通知', '后台打款给用户的时候', 'a:3:{s:8:\"send_sms\";i:1;s:10:\"send_email\";i:1;s:15:\"send_mobile_sms\";i:1;}', '1364996161')");



db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_tpl` VALUES ('268', 'task_end_manually', '<p>您发布的{模型名称}任务{任务标题}被管理员手动结束，原因：{理由}<p>', null, '0')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_tpl` VALUES ('269', 'alipayjs_auth', '<p>您申请的支付宝认证已经受理，管理员已经打款到您的账户，请及时查收，并在<a href=\"index.php?do=user&view=account&op=index&code=alipayjs\">确认收款金额</a>中填写您收到的金额数，以便你认证成功！</p>', '1', '0')");
db_factory::execute("REPLACE INTO `".TABLEPRE."witkey_msg_tpl` VALUES ('270', 'alipayjs_auth', '<p>您申请的支付宝认证已经受理，管理员已经打款到您的账户，请及时查收，并在<a href=\"index.php?do=user&view=account&op=index&code=alipayjs\">确认收款金额</a>中填写您收到的金额数，以便你认证成功！</p>', '2', '0')");
